home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news text
| default
| |
99%
| file
| C++ source text
| default
| |
98%
| file
| C++ source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 69 73 | 6f 6e 65 77 73 2e 62 62 |Path: is|onews.bb|
|00000010| 6e 2e 68 70 2e 63 6f 6d | 21 6e 65 77 73 0a 46 72 |n.hp.com|!news.Fr|
|00000020| 6f 6d 3a 20 4d 61 6e 66 | 72 65 64 5f 4c 61 6e 67 |om: Manf|red_Lang|
|00000030| 65 20 3c 4d 61 6e 66 72 | 65 64 5f 4c 61 6e 67 65 |e <Manfr|ed_Lange|
|00000040| 40 62 62 6e 2e 68 70 2e | 63 6f 6d 3e 0a 4e 65 77 |@bbn.hp.|com>.New|
|00000050| 73 67 72 6f 75 70 73 3a | 20 63 6f 6d 70 2e 6c 61 |sgroups:| comp.la|
|00000060| 6e 67 2e 63 2b 2b 0a 53 | 75 62 6a 65 63 74 3a 20 |ng.c++.S|ubject: |
|00000070| 52 65 3a 20 51 75 65 73 | 74 69 6f 6e 20 61 62 6f |Re: Ques|tion abo|
|00000080| 75 74 20 64 65 73 74 72 | 75 63 74 6f 72 2e 2e 2e |ut destr|uctor...|
|00000090| 0a 44 61 74 65 3a 20 38 | 20 4a 61 6e 20 31 39 39 |.Date: 8| Jan 199|
|000000a0| 36 20 31 30 3a 32 35 3a | 32 32 20 47 4d 54 0a 4f |6 10:25:|22 GMT.O|
|000000b0| 72 67 61 6e 69 7a 61 74 | 69 6f 6e 3a 20 48 65 77 |rganizat|ion: Hew|
|000000c0| 6c 65 74 74 2d 50 61 63 | 6b 61 72 64 2c 20 45 75 |lett-Pac|kard, Eu|
|000000d0| 72 6f 70 65 61 6e 20 53 | 75 70 70 6f 72 74 20 54 |ropean S|upport T|
|000000e0| 65 63 68 6e 6f 6c 6f 67 | 79 20 4c 61 62 20 28 45 |echnolog|y Lab (E|
|000000f0| 53 54 4c 29 0a 4d 65 73 | 73 61 67 65 2d 49 44 3a |STL).Mes|sage-ID:|
|00000100| 20 3c 34 63 71 72 65 69 | 24 70 61 72 40 69 73 6f | <4cqrei|$par@iso|
|00000110| 69 74 31 30 39 2e 62 62 | 6e 2e 68 70 2e 63 6f 6d |it109.bb|n.hp.com|
|00000120| 3e 0a 52 65 66 65 72 65 | 6e 63 65 73 3a 20 3c 34 |>.Refere|nces: <4|
|00000130| 63 65 39 6d 6b 24 61 74 | 67 40 65 6e 67 5f 73 65 |ce9mk$at|g@eng_se|
|00000140| 72 31 2e 65 72 67 2e 63 | 75 68 6b 2e 68 6b 3e 0a |r1.erg.c|uhk.hk>.|
|00000150| 4e 4e 54 50 2d 50 6f 73 | 74 69 6e 67 2d 48 6f 73 |NNTP-Pos|ting-Hos|
|00000160| 74 3a 20 68 70 65 73 74 | 6c 30 38 2e 62 62 6e 2e |t: hpest|l08.bbn.|
|00000170| 68 70 2e 63 6f 6d 0a 4d | 69 6d 65 2d 56 65 72 73 |hp.com.M|ime-Vers|
|00000180| 69 6f 6e 3a 20 31 2e 30 | 0a 43 6f 6e 74 65 6e 74 |ion: 1.0|.Content|
|00000190| 2d 54 79 70 65 3a 20 74 | 65 78 74 2f 70 6c 61 69 |-Type: t|ext/plai|
|000001a0| 6e 3b 20 63 68 61 72 73 | 65 74 3d 75 73 2d 61 73 |n; chars|et=us-as|
|000001b0| 63 69 69 0a 43 6f 6e 74 | 65 6e 74 2d 54 72 61 6e |cii.Cont|ent-Tran|
|000001c0| 73 66 65 72 2d 45 6e 63 | 6f 64 69 6e 67 3a 20 37 |sfer-Enc|oding: 7|
|000001d0| 62 69 74 0a 58 2d 4d 61 | 69 6c 65 72 3a 20 4d 6f |bit.X-Ma|iler: Mo|
|000001e0| 7a 69 6c 6c 61 20 31 2e | 32 32 20 28 57 69 6e 64 |zilla 1.|22 (Wind|
|000001f0| 6f 77 73 3b 20 49 3b 20 | 33 32 62 69 74 29 0a 54 |ows; I; |32bit).T|
|00000200| 6f 3a 20 79 77 6c 65 75 | 6e 67 40 63 73 2e 63 75 |o: ywleu|ng@cs.cu|
|00000210| 68 6b 2e 68 6b 0a 0a 79 | 77 6c 65 75 6e 67 40 63 |hk.hk..y|wleung@c|
|00000220| 73 2e 63 75 68 6b 2e 68 | 6b 20 28 4d 61 72 74 79 |s.cuhk.h|k (Marty|
|00000230| 20 4d 63 46 6c 79 29 20 | 77 72 6f 74 65 3a 0a 3e | McFly) |wrote:.>|
|00000240| 44 65 61 72 20 41 6c 6c | 2c 0a 3e 0a 3e 09 49 20 |Dear All|,.>.>.I |
|00000250| 6e 6f 77 20 68 61 76 65 | 20 32 20 63 6c 61 73 73 |now have| 2 class|
|00000260| 65 73 20 41 20 61 6e 64 | 20 42 2e 20 20 42 20 69 |es A and| B. B i|
|00000270| 73 20 61 20 64 65 72 69 | 76 65 64 20 63 6c 61 73 |s a deri|ved clas|
|00000280| 73 20 6f 66 20 41 2e 20 | 20 48 6f 77 65 76 65 72 |s of A. | However|
|00000290| 2c 0a 3e 74 68 65 20 69 | 6e 74 65 72 6e 61 6c 20 |,.>the i|nternal |
|000002a0| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 20 6f |implemen|tation o|
|000002b0| 66 20 41 20 69 73 20 6e | 6f 74 20 6b 6e 6f 77 6e |f A is n|ot known|
|000002c0| 2c 20 69 2e 65 2e 2c 20 | 74 68 65 20 70 72 69 76 |, i.e., |the priv|
|000002d0| 61 74 65 20 6d 65 6d 62 | 65 72 73 20 6f 66 0a 3e |ate memb|ers of.>|
|000002e0| 63 6c 61 73 73 20 41 20 | 61 72 65 20 6e 6f 74 20 |class A |are not |
|000002f0| 70 72 6f 76 69 64 65 64 | 2c 20 6f 6e 6c 79 20 74 |provided|, only t|
|00000300| 68 65 20 70 75 62 6c 69 | 63 20 6d 65 6d 62 65 72 |he publi|c member|
|00000310| 73 20 61 72 65 20 67 69 | 76 65 6e 2e 20 20 42 75 |s are gi|ven. Bu|
|00000320| 74 20 63 6c 61 73 73 20 | 42 20 69 73 20 0a 3e 69 |t class |B is .>i|
|00000330| 6d 70 6c 65 6d 65 6e 74 | 65 64 20 62 79 20 6d 79 |mplement|ed by my|
|00000340| 73 65 6c 66 2e 20 20 53 | 6f 20 77 68 61 74 20 73 |self. S|o what s|
|00000350| 68 6f 75 6c 64 20 62 65 | 20 77 72 69 74 74 65 6e |hould be| written|
|00000360| 20 69 6e 20 74 68 65 20 | 64 65 73 74 72 75 63 74 | in the |destruct|
|00000370| 6f 72 20 6f 66 20 42 20 | 73 6f 20 0a 3e 74 68 61 |or of B |so .>tha|
|00000380| 74 20 61 6c 6c 20 74 68 | 65 20 70 72 69 76 61 74 |t all th|e privat|
|00000390| 65 20 6d 65 6d 62 65 72 | 73 20 69 6e 68 65 72 69 |e member|s inheri|
|000003a0| 74 65 64 20 66 72 6f 6d | 20 41 20 61 72 65 20 61 |ted from| A are a|
|000003b0| 6c 73 6f 20 22 64 65 6c | 65 74 65 64 22 3f 0a 3e |lso "del|eted"?.>|
|000003c0| 0a 3e 52 65 67 61 72 64 | 73 2c 0a 3e 4d 61 72 74 |.>Regard|s,.>Mart|
|000003d0| 79 20 4d 63 46 6c 79 2e | 0a 3e 0a 3e 0a 0a 44 6f |y McFly.|.>.>..Do|
|000003e0| 20 79 6f 75 20 70 6c 61 | 6e 20 74 6f 20 67 6f 20 | you pla|n to go |
|000003f0| 74 6f 20 74 68 65 20 22 | 44 61 6e 63 65 20 75 6e |to the "|Dance un|
|00000400| 64 65 72 20 74 68 65 20 | 73 65 61 22 3f 0a 0a 0a |der the |sea"?...|
|00000410| 49 20 73 61 77 20 61 6c | 6c 20 74 68 65 20 61 6e |I saw al|l the an|
|00000420| 73 77 65 72 73 20 79 6f | 75 20 67 6f 74 20 66 6f |swers yo|u got fo|
|00000430| 72 20 79 6f 75 72 20 71 | 75 65 73 74 69 6f 6e 2e |r your q|uestion.|
|00000440| 20 49 74 20 69 73 20 74 | 72 75 65 2c 20 74 68 61 | It is t|rue, tha|
|00000450| 74 20 79 6f 75 20 64 6f | 6e 27 74 20 68 61 76 65 |t you do|n't have|
|00000460| 20 0a 74 6f 20 63 61 72 | 65 20 66 6f 72 20 74 68 | .to car|e for th|
|00000470| 65 20 64 65 73 74 72 75 | 63 74 6f 72 20 69 6e 20 |e destru|ctor in |
|00000480| 74 68 65 20 62 61 73 65 | 63 6c 61 73 73 2e 0a 0a |the base|class...|
|00000490| 42 75 74 20 74 68 65 72 | 65 20 69 73 20 61 6e 6f |But ther|e is ano|
|000004a0| 74 68 65 72 20 61 73 70 | 65 63 74 20 6f 66 20 74 |ther asp|ect of t|
|000004b0| 68 65 20 70 72 6f 62 6c | 65 6d 2c 20 74 68 61 74 |he probl|em, that|
|000004c0| 20 69 73 20 69 6d 70 6f | 72 74 61 6e 74 20 74 6f | is impo|rtant to|
|000004d0| 20 6b 6e 6f 77 2e 20 54 | 61 6b 65 20 74 68 65 20 | know. T|ake the |
|000004e0| 0a 66 6f 6c 6c 6f 77 69 | 6e 67 20 73 61 6d 70 6c |.followi|ng sampl|
|000004f0| 65 3a 0a 0a 63 6c 61 73 | 73 20 42 61 73 65 0a 7b |e:..clas|s Base.{|
|00000500| 0a 20 20 20 7e 42 61 73 | 65 28 29 3b 0a 7d 3b 0a |. ~Bas|e();.};.|
|00000510| 0a 63 6c 61 73 73 20 44 | 65 72 69 76 65 64 20 3a |.class D|erived :|
|00000520| 20 70 75 62 6c 69 63 20 | 42 61 73 65 0a 7b 0a 20 | public |Base.{. |
|00000530| 20 20 7e 44 65 72 69 76 | 65 64 28 29 3b 0a 7d 3b | ~Deriv|ed();.};|
|00000540| 0a 0a 2e 2e 0a 0a 7b 20 | 20 42 61 73 65 2a 20 20 |......{ | Base* |
|00000550| 20 61 42 61 73 65 3b 0a | 0a 20 20 20 61 42 61 73 | aBase;.|. aBas|
|00000560| 65 20 3d 20 6e 65 77 20 | 44 65 72 69 76 65 64 28 |e = new |Derived(|
|00000570| 29 3b 0a 0a 20 20 20 2e | 2e 2e 0a 0a 20 20 20 64 |);.. .|.... d|
|00000580| 65 6c 65 74 65 20 61 42 | 61 73 65 3b 0a 0a 2e 2e |elete aB|ase;....|
|00000590| 0a 0a 0a 57 68 69 63 68 | 20 64 65 73 74 72 75 63 |...Which| destruc|
|000005a0| 74 6f 72 20 77 69 6c 6c | 20 62 65 20 63 61 6c 6c |tor will| be call|
|000005b0| 65 64 20 77 68 65 6e 20 | 65 78 65 63 75 74 69 6e |ed when |executin|
|000005c0| 67 20 22 64 65 6c 65 74 | 65 20 61 42 61 73 65 28 |g "delet|e aBase(|
|000005d0| 29 22 20 3f 0a 0a 49 66 | 20 74 68 65 20 63 6c 61 |)" ?..If| the cla|
|000005e0| 73 73 65 73 20 61 72 65 | 20 64 65 63 6c 61 72 65 |sses are| declare|
|000005f0| 64 20 74 68 65 20 77 61 | 79 20 74 68 65 79 20 61 |d the wa|y they a|
|00000600| 72 65 20 69 6e 20 74 68 | 65 20 73 61 6d 70 6c 65 |re in th|e sample|
|00000610| 2c 20 74 68 65 6e 20 6f | 6e 6c 79 20 74 68 65 20 |, then o|nly the |
|00000620| 0a 42 61 73 65 2d 6c 6f | 6f 6b 69 6e 67 20 70 61 |.Base-lo|oking pa|
|00000630| 72 74 20 6f 66 20 74 68 | 65 20 6f 62 6a 65 63 74 |rt of th|e object|
|00000640| 20 77 69 6c 6c 20 62 65 | 20 64 65 73 74 72 6f 79 | will be| destroy|
|00000650| 65 64 2e 20 54 68 65 20 | 22 44 65 72 69 76 65 64 |ed. The |"Derived|
|00000660| 2d 6c 6f 6f 6b 69 6e 67 | 22 20 70 61 72 74 0a 6f |-looking|" part.o|
|00000670| 66 20 74 68 65 20 6f 62 | 6a 65 63 74 20 77 69 6c |f the ob|ject wil|
|00000680| 6c 20 72 65 6d 61 69 6e | 20 69 6e 20 6d 65 6d 6f |l remain| in memo|
|00000690| 72 79 2c 20 74 68 75 73 | 20 63 61 75 73 69 6e 67 |ry, thus| causing|
|000006a0| 20 6d 65 6d 6f 72 79 2d | 6c 65 61 6b 73 21 0a 0a | memory-|leaks!..|
|000006b0| 53 6f 20 74 68 65 20 61 | 6e 73 77 65 72 20 74 6f |So the a|nswer to|
|000006c0| 20 79 6f 75 72 20 71 75 | 65 73 74 69 6f 6e 20 64 | your qu|estion d|
|000006d0| 65 70 65 6e 64 73 20 6f | 6e 20 48 4f 57 20 79 6f |epends o|n HOW yo|
|000006e0| 75 20 63 61 6c 6c 20 74 | 68 65 20 64 65 73 74 72 |u call t|he destr|
|000006f0| 75 63 74 6f 72 20 66 6f | 72 20 74 68 65 20 0a 64 |uctor fo|r the .d|
|00000700| 65 72 69 76 65 64 20 63 | 6c 61 73 73 21 0a 0a 54 |erived c|lass!..T|
|00000710| 68 65 20 73 6f 6c 75 74 | 69 6f 6e 20 66 6f 72 20 |he solut|ion for |
|00000720| 74 68 65 20 67 69 76 65 | 6e 20 73 61 6d 70 6c 65 |the give|n sample|
|00000730| 20 77 6f 75 6c 64 20 62 | 65 20 74 6f 20 64 65 63 | would b|e to dec|
|00000740| 6c 61 72 65 20 74 68 65 | 20 64 65 73 74 72 75 63 |lare the| destruc|
|00000750| 74 6f 72 20 6f 66 20 74 | 68 65 20 62 61 73 65 20 |tor of t|he base |
|00000760| 0a 63 6c 61 73 73 20 61 | 73 20 76 69 72 74 75 61 |.class a|s virtua|
|00000770| 6c 3a 0a 0a 63 6c 61 73 | 73 20 42 61 73 65 0a 7b |l:..clas|s Base.{|
|00000780| 0a 20 20 20 76 69 72 74 | 75 61 6c 20 7e 42 61 73 |. virt|ual ~Bas|
|00000790| 65 28 29 3b 0a 7d 3b 0a | 0a 48 6f 70 65 20 74 68 |e();.};.|.Hope th|
|000007a0| 69 73 20 68 65 6c 70 73 | 2e 0a 0a 2d 2d 20 0a 52 |is helps|...-- .R|
|000007b0| 65 67 61 72 64 73 2c 20 | 4d 61 6e 66 72 65 64 2e |egards, |Manfred.|
|000007c0| 0a 0a 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |..------|--------|
|000007d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000007e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0a 4d 61 6e |--------|----.Man|
|000007f0| 66 72 65 64 20 4c 61 6e | 67 65 0a 48 65 77 6c 65 |fred Lan|ge.Hewle|
|00000800| 74 74 2d 50 61 63 6b 61 | 72 64 20 28 44 65 75 74 |tt-Packa|rd (Deut|
|00000810| 73 63 68 6c 61 6e 64 29 | 20 47 6d 62 48 0a 45 53 |schland)| GmbH.ES|
|00000820| 54 4c 20 28 45 75 72 6f | 70 65 61 6e 20 53 75 70 |TL (Euro|pean Sup|
|00000830| 70 6f 72 74 20 54 65 63 | 68 6e 6f 6c 6f 67 79 20 |port Tec|hnology |
|00000840| 4c 61 62 29 0a 42 6f 65 | 62 6c 69 6e 67 65 6e 2c |Lab).Boe|blingen,|
|00000850| 20 47 65 72 6d 61 6e 79 | 0a 65 6d 61 69 6c 3a 20 | Germany|.email: |
|00000860| 4d 61 6e 66 72 65 64 5f | 4c 61 6e 67 65 40 62 62 |Manfred_|Lange@bb|
|00000870| 6e 2e 68 70 2e 63 6f 6d | 0a 0a 4d 79 20 6f 70 69 |n.hp.com|..My opi|
|00000880| 6e 69 6f 6e 20 64 6f 65 | 73 20 6e 6f 74 20 6e 65 |nion doe|s not ne|
|00000890| 65 64 20 74 6f 20 62 65 | 20 74 68 61 74 20 6f 66 |ed to be| that of|
|000008a0| 20 48 50 21 0a 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d | HP!.---|--------|
|000008b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000008c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0a |--------|-------.|
|000008d0| 0a 0a | |.. | |
+--------+-------------------------+-------------------------+--------+--------+